home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / DB_CLIPP / 2510.ZIP / TRSOURCE.EXE / _TR_ISDS.C < prev    next >
C/C++ Source or Header  |  1990-10-22  |  630b  |  30 lines

  1. /*********
  2. *
  3. * _TR_ISDS.C
  4. *
  5. * by Tom Rettig
  6. *
  7. * Placed in the public domain by Tom Rettig Associates, 10/22/1990.
  8. *
  9. * Syntax: _tr_isdsvalid( <date string> )
  10. * Return: TRUE if <date string> is a valid date, otherwise FALSE
  11. * Note  : <date string> is *char in the DTOS() format "YYYYMMDD"
  12. ********/
  13.  
  14. #include "trlib.h"
  15.  
  16. int _tr_isdsvalid(ds)
  17. char *ds;
  18. {
  19.  
  20.    if ( ISDS(ds) )           /* ds is in date string format */
  21.    {
  22.       /* _tr_ldm() returns zero if invalid month or year */
  23.       return( DSDAY(ds) >= 1 && DSDAY(ds) <= _tr_ldm(DSMONTH(ds),DSYEAR(ds)) );
  24.    }
  25.    else
  26.       return( FALSE );
  27. }
  28.  
  29.  
  30.